package com.njwb.day03;

import java.util.Arrays;

public class c1 {
    public static void main(String[] args) {

/*        需求：多个学生按不同成绩降序排序（每个学生拥有三门成绩）
        {{张三，李四，王五},{语文，数学，英语}}
        {{88,90,60},{80,96,74},{95,50,87}}*/



        String[][] a= {{"张三","李四","王五"},{"语文","数学","英语"}};
        String[][] paiming={{"张三","李四","王五"},{"张三","李四","王五"},{"张三","李四","王五"}};
        int [][] score={{88,90,60},{80,96,74},{95,50,87}};
        for (int i=0;i<a[1].length;i++){

for (int i1=0;i1<a[0].length-1;i1++){
    for (int k=i1+1;k<a[0].length;k++)
    {
        if (score[i1][i]<score[k][i]){
            int aa=score[i1][i];
            String bb=paiming[i][i1];
            score[i1][i]=score[k][i];
            score[k][i]=aa;
            paiming[i][i1]=paiming[i][k];
            paiming[i][k]=bb;


        }

    }






}
        }

     for (int i=0;i<a[1].length;i++)  {
         System.out.println(a[1][i]+"成绩排名：");
         System.out.println();
         for (int k=0;k<a[0].length;k++){
             System.out.println(k+1+"."+paiming[i][k]+":"+score[k][i]);
         }
         System.out.println();
     }




    }
}
